<?php
/**
 * CakePHP Tags Plugin
 *
 * Copyright 2009 - 2010, Cake Development Corporation
 *                        1785 E. Sahara Avenue, Suite 490-423
 *                        Las Vegas, Nevada 89104
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 */
?>
<div class="tags index">
    <h2>
        <?php __('Tags'); ?>
    </h2>
    <p>
        <?php
        echo $this->Paginator->counter(array(
            'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
        ));
        ?>
    </p>

    <div class="tagsline">
        <table>
            <tbody>
                <tr>
                    <td style="min-width:150px;">
        <?php
            $i = 0;
            foreach($tags as $tag)
            {
        ?>
            <?php
                if(count($tag['Tagged']))
                    echo $this->Html->link(__($tag['Tag']['name'], true), array('plugin' => null, 'controller' => 'messages', 'action' => 'havingTag', $tag['Tag']['keyname'])) . "<b>&nbsp;x&nbsp;" . count($tag['Tagged']) . "</b>";
                else
                    echo $this->Html->tag('span',__($tag['Tag']['name'], true));
                echo "<br>";
                $i++;
                if( $i % 6 == 0 )
                    echo "</td><td style=\"min-width:150px;\">";
            ?>
        <?php
            }
        ?>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>

</div>

<div class="paging">
    <?php
        echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class' => 'disabled'));
    ?>
        |
    <?php
        echo $this->Paginator->numbers();
    ?>
        |
    <?php
        echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));
    ?>
</div>